import { http } from '@/http'
import { baseConfig } from '@/http/request'

export const api = {
  login: '/cms/pub/user/loginCms',
  getVerificationCode: '/cms/pub/user/getVerificationCode'
}

export const loginAPI = (data) => {
  return http.post(api.login, data)
}

// 获取验证码图片
export const getVerificationCodeAPI = (codeKey) => {
  const base = baseConfig.baseURL.replace(/\/+$/, '')
  const path = api.getVerificationCode.replace(/^\/+/, '')
  return `${base}/${path}?codeKey=${codeKey}`
}

// // 获取租户ID
// export const getTenantIdByName = (data) => {
//   return http.get(`${api.getTenantIdByName}?name=${data}`)
// }
